﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace CmdServer
{
    class WorkCar
    {
        public string Title = "";
        IServer server;
        public bool IsRunning = false;
        int TimeSpan = 0;
        public WorkCar(IServer server)
        {
            this.server = server;
            Title = server.GetTitle();
            TimeSpan = server.GetTimeSpan();
        }
        public void DoWork()
        {
            while(true)
            {
                IsRunning = true;
                server.DoWork();
                IsRunning = false;
                Thread.Sleep(TimeSpan);
            }
        }
    }
}
